DragAlignedGrayRgn
TheDragAlignedGrayRgn
function drags the specified gray region along an optimal alignment grid.
pascal long DragAlignedGrayRgn (RgnHandle theRgn, Point startPt, Rect *boundsRect, Rect *slopRect, short axis, ProcPtr actionProc, Rect *alignmentRect, AlignmentProcRecordPtr alignmentProc);
theRgn
- Contains a region handle to the specified region for this operation. When the user holds down the mouse button,
DragAlignedGrayRgn
pulls a gray outline of the region around following the movement of the mouse until the mouse button is released.startPt
- Specifies the point where the mouse button was originally pressed in the local coordinates of the current graphics port.
boundsRect
Contains a pointer to the boundary rectangle of the current graphics port. The offset point follows the mouse location except thatDragAlignedGrayRgn
never moves the offset point outside this rectangle. This limits the travel of the region's outline, not the movements of the mouse.slopRect
- Contains a pointer to the
slop
rectangle that completely encloses the boundary rectangle so that the user is allowed some flexibility in moving the mouse.axis
- Allows you to constrain the region's motion to only one axis. Set this parameter to 0 to specify no constraint. To indicate constraint along
a horizontal axis, set this parameter to 1. To indicate constraint along a vertical axis, set this parameter to 2. See Inside Macintosh: Macintosh ToolBox Essentials Essentials for details on the constants for the axis parameter of the Window Manager'sDragGrayRgn
routine.actionProc
- Points to a function that defines some action to be performed repeatedly as long as the user holds down the mouse button. The function should have no parameters. If the
actionProc
parameter isnil
,DragAlignedGrayRgn
simply retains control until the mouse button is released.alignmentRect
Contains a pointer to a rectangle within the bounds of the region specified in the parametertheRgn
. Passnil
to align using the bounds of the parametertheRgn
.alignmentProc
- Points to your own alignment behavior function. Pass
nil
to use the standard behavior. Your alignment function must be in the following form:
- pascal void MyAlignmentProc (Rect *rp, long refcon);
See "Alignment Functions" on page 3-149 for details.DESCRIPTION
TheDragAlignedGrayRgn
function is not normally made directly. TheDragAlignedWindow
function (described on page 3-138) calls this function.SEE ALSO
TheDragAlignedGrayRgn
function is nearly identical to the Window Manager'sDragGrayRgn
routine. See Inside Macintosh: Macintosh ToolBox Essentials Essentials for
details onDragGrayRgn
.